gtktexthandle: Set parent through API call
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 24 Apr 2020 22:09:41 +0000 (00:09 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 24 Apr 2020 22:09:41 +0000 (00:09 +0200)
The GtkWidget::parent property went readonly, use the API call
to ensure the text handle has a parent set.

gtk/gtktexthandle.c

index c38c3c08b52c2851bc0df464ace4fadccb7311a4..fda579ca524224ca64c2e837abfef45da89c0c36 100644 (file)
@@ -459,10 +459,14 @@ gtk_text_handle_init (GtkTextHandle *widget)
 GtkTextHandle *
 gtk_text_handle_new (GtkWidget *parent)
 {
-  return g_object_new (GTK_TYPE_TEXT_HANDLE,
-                       "parent", parent,
-                       "css-name", I_("cursor-handle"),
-                       NULL);
+  GtkTextHandle *handle;
+
+  handle = g_object_new (GTK_TYPE_TEXT_HANDLE,
+                         "css-name", I_("cursor-handle"),
+                         NULL);
+  gtk_widget_set_parent (GTK_WIDGET (handle), parent);
+
+  return handle;
 }
 
 void